package org.xxx.search.model.vo;

import lombok.Data;
import org.xxx.search.annotation.ColumnHeader;
import org.xxx.search.annotation.QuerySelect;

import java.math.BigDecimal;
import java.time.LocalDate;

/**
 * @author Deveik
 */
@Data
public class BookSearchItem {
    @ColumnHeader(label = "书名")
    @QuerySelect(from = "book")
    private String name;
    @ColumnHeader(label = "作者")
    @QuerySelect(from = "book")
    private String authorName;
    @ColumnHeader(label = "出版社")
    @QuerySelect(from = "book")
    private String publisher;
    @ColumnHeader(label = "发版日期")
    @QuerySelect(from = "book")
    private LocalDate releaseDate;
    @ColumnHeader(label = "价格")
    @QuerySelect(from = "commodity")
    private BigDecimal price;
    @ColumnHeader(label = "重量")
    @QuerySelect(alias = "(commodity.weight / 1000)")
    private BigDecimal weight;
    @ColumnHeader(label = "存量")
    @QuerySelect(additive = true, from = "commodity")
    private Integer rest;
}


